package antmongo

import (
	DataModel "EsTag/dataModel"
	EsUtility "EsTag/esUtility"
	"fmt"

	"gopkg.in/mgo.v2"
)

func QueryAllUsers(from int, limit int) []DataModel.Model_UIDLIST {
	var usersAll []DataModel.Model_UIDLIST
	OPC("userlist", func(d *mgo.Collection) {
		err := d.Find(nil).Skip(from).Limit(limit).All(&usersAll)
		if err != nil {
			fmt.Println("QueryAllUsers err", err.Error())
		}
	})
	return usersAll
}

func QueryJjhUsers(from int, limit int) []EsUtility.JjhModel {
	var usersAll []EsUtility.JjhModel
	OPC("userlist", func(d *mgo.Collection) {
		err := d.Find(nil).Skip(from).Limit(limit).All(&usersAll)
		if err != nil {
			fmt.Println("QueryAllUsers err", err.Error())
		}
	})
	return usersAll
}
